/**
 * 
 */
package com.dsteiner.gwt.cafeteriasophia.client;

import com.dsteiner.gwt.cafeteriasophia.client.controller.ShiftChangeSelectionController;
import com.dsteiner.gwt.cafeteriasophia.client.model.ShiftChangeSelectionModel;
import com.dsteiner.gwt.cafeteriasophia.client.model.StatisticModel;
import com.dsteiner.widgets.client.Widgets.CheckBoxExt;
import com.dsteiner.widgets.client.Widgets.HTMLExt;
import com.dsteiner.widgets.client.Widgets.LazyWidget;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Widget;

public class ShiftChangeSelectionWidget extends LazyWidget {

	private ShiftChangeSelectionController shiftChangeSelectionController = new ShiftChangeSelectionController();
	private final ShiftChangeSelectionModel shiftChangeSelectionModel;
	private final StatisticModel statisticModel;

	public ShiftChangeSelectionWidget(ShiftChangeSelectionModel shiftChangeSelectionModel, 
			StatisticModel statisticModel) {
		this.shiftChangeSelectionModel = shiftChangeSelectionModel;
		this.statisticModel = statisticModel;
		setStyleName("shiftChangeSelection-widget");
	}

	@Override
	public Widget createContentWidget() {
		HorizontalPanel mainPanel = new HorizontalPanel();
		HTMLExt infoHtml = new HTMLExt();
		CheckBoxExt checkBox = new CheckBoxExt(); 
		
		mainPanel.add(infoHtml);
		mainPanel.add(checkBox);
		
		infoHtml.setWidth("300px");
		
		shiftChangeSelectionController.registerCheckBox(checkBox);
		shiftChangeSelectionController.registerInfoHtml(infoHtml);
		shiftChangeSelectionController.registerStatisticModel(statisticModel);
		shiftChangeSelectionController.registerShiftChangeSelectionWidget(this);
		shiftChangeSelectionController.registerShiftChangeSelectionModel(shiftChangeSelectionModel);
		return mainPanel;
	}

}